import com.tengfei.pojo.Student;
import com.tengfei.pojo.User;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Description:
 * @author: ten_fei
 * @date: 2021-07-05 21:08
 */
public class test1 {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("ApplicationContent.xml");
        Student student = (Student) context.getBean("student");
        System.out.println(student.toString());

        /**
         *
         * Student{
         *          name='feige',
         *          age=0,
         *          address=Address{address='南昌'},
         *          books=[红楼梦, 西游记, 水浒传, 三国演义],
         *          hobbys=[听歌, 敲代码, 打游戏],
         *          card={name=feige, age=18, sex=男},
         *          games=[LoL, PUBG, GTA5],
         *          info={name=张三, sex=男, id=123456}, wife='null'
         * }
         *
         */
    }

    @Test
    public void test2(){
        ApplicationContext context=new ClassPathXmlApplicationContext("userbean.xml");
        Object user = context.getBean("user",User.class);
        Object user2=context.getBean("user",User.class);
        System.out.println(user==user2);

    }
}
